import _routesConfig from './automatic/routes';
import { lazy } from 'react';

export const routesConfig = _routesConfig;

const rnextPathName = ['app', 'crud', 'list'];

export default _routesConfig.map(item => {

  const arr = item.path.split('/');
  const isRnextPath = rnextPathName.includes(arr[1]);

  return {
    path: item.path,
    component: isRnextPath ? lazy(() => import('./../../pages' + item.componentPath))
      : lazy(() => import('./../../../src/pages' + item.componentPath)),
    exact: true
  }
})